package com.apes.auto.car.model;

import com.alibaba.fastjson.annotation.JSONField;
import com.apes.framework.jpa.ApesBean;
import com.apes.framework.jpa.DefaultPersistListener;
import com.apes.framework.jpa.comment.Comment;
import com.apes.framework.jpa.generator.ApesGenerator;
import com.apes.framework.util.DateUtil;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SelectBeforeUpdate;

import javax.persistence.*;
import java.util.Date;

/**
 * @ClassName PartsElectronicCatalogue
 * @Description 配件电子目录
 * @Author pengyb
 * @Date 2019/8/2 11:31
 * @Version 1.0
 **/
@Getter
@Setter
@SelectBeforeUpdate
@DynamicInsert
@DynamicUpdate
@Entity
@EntityListeners(DefaultPersistListener.class)
@Table(name = PartsElectronicCatalogue.CONST_TABLE_NAME)
public class PartsElectronicCatalogue implements ApesBean {
    public static final String CONST_TABLE_NAME = "DZML_PJMC";

    @Id
    @Column(name = "PJMCID", length = 32)
    @ApesGenerator(code = CONST_TABLE_NAME, name = "配件名称编码")
    private String PJMCID;

    @Column(name = "PJMC", length = 128)
    @Comment("配件名称")
    private String PJMC;

    @Column(name = "PLID", length = 16)
    @Comment("品类编码")
    private String PLID;

    @Column(name = "PLMC", length = 128)
    @Comment("品类名称")
    private String PLMC;

    @Column(name = "ZDYID")
    @Comment("自定义ID自增")
    private int ZDYID;

    @Column(name = "TS01", length = 36)
    @Comment("时间戳")
    private String TS01;

    @Column(name = "LRR", length = 64)
    @Comment("录入人")
    private String LRR;

    @JSONField(format = DateUtil.SHOW_DATE_FORMAT)
    @Temporal(TemporalType.DATE)
    @Column(name = "LRRQ_SJ")
    private Date LRRQ_SJ; //录入日期

    @Column(name = "BZ", length = 128)
    @Comment("备注")
    private String BZ;


}
